// src/router/index.js
import { createRouter, createWebHistory } from 'vue-router' // Vue 3
// import Vue from 'vue' // Vue 2
// import VueRouter from 'vue-router' // Vue 2
import { HomeFilled, Document, InfoFilled } from '@element-plus/icons-vue'

import Home from '../views/Home.vue'
import About from '../views/About.vue'
import TodoApp from '@/views/TodoApp/TodoApp.vue'

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    meta: {
      title: '首页',
      icon: 'HomeFilled',
    },
  },
  {
    path: '/TodoApp',
    name: 'TodoApp',
    component: TodoApp,
    meta: {
      title: '待办事项',
      icon: 'Document',
    },
  },
  {
    path: '/about',
    name: 'About',
    component: About,
    meta: {
      title: '关于我们',
      icon: 'InfoFilled',
    },
  },
]

const router = createRouter({
  history: createWebHistory(),
  routes,
})

export default router
